export const resetSetItem = (key: any, newVal: any) => {
  if (key === 'newDate') {
    const storage = {
      setItem: function (k: any, val: any) {
        sessionStorage.setItem(k, val);
        // 创建一个 CustomEvent 事件
        const newStorageEvent = new CustomEvent('setItem', {
          bubbles: false,
          cancelable: false,
          detail: {
            key: k,
            oldValue: null,
            newValue: val,
            url: null,
          },
        });
        // 派发对象
        window.dispatchEvent(newStorageEvent);
      },
    };

    return storage.setItem(key, newVal);
  }
};
